<?php 
function getPostURL() { 
 $postURL = 'http'; 
 if ($_SERVER["HTTPS"] == "on") {$postURL .= "s";} 
 $postURL .= "://"; 
 if ($_SERVER["SERVER_PORT"] != "80") { 
  $postURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; 
 } else { 
  $postURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; 
 } 
 return $postURL; 
} 
$postURL=getPostURL(); 
 
echo '<iframe src="http://www.facebook.com/widgets/like.php?href='.$postURL.'" 
        scrolling="no" frameborder="0" 
        style="border:none; width:450px; height:40px"></iframe>'; 
?>

If you are using WordPress as a blogging platform, you can easily copy and paste the code above just before the "the_content" function:

<?php the_content( __('<p>Read the rest of this entry &raquo;</p>', 'arras') ); ?>

It should then look like the the screen shot below:


Read more at http://www.devshed.com/c/a/PHP/Facebook-PHP-API-Applications-Basic-Introduction/2/#sg2CS1JA5XjBpxRQ.99